using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Main.admin
{
    public partial class CreateUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            CreateUserWizard wizard = (CreateUserWizard)sender;
            MembershipUser user = Membership.GetUser(wizard.UserName);
            if (user != null)
            {
                try
                {
                    debugLabel.Text = "Created User: " + user.UserName + "\n" + "E-mail Address" + user.Email;
                    user.IsApproved = false;
                    Email.SendMail(user.UserName, user.Email, "Account Confirmation Email", "Please click the" +
                        "link below to confirm your account.<br><br><a href=\"localhost:2424/users/Confirm.aspx?id=" +
                        user.ProviderUserKey.ToString() + "\">Click here to confirm.</a>");
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Trace.WriteLine(ex.Message);
                }
            }
        }
    }
}
